package com.travelbid.admin.struts.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.springframework.web.struts.ActionSupport;

import com.travelbid.admin.pojo.TUser;



public class AddUserAction extends ActionSupport{
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		response.setContentType("text/xml;charset=UTF-8");
		response.setHeader("Cache-Control", "no-cache");
		Integer userId = (Integer) request.getSession().getAttribute("USER_ID");
		
		TUser user=(TUser)request.getSession().getAttribute("user");
		if (userId != null) {
			 if(user.getType().intValue()!=0)
				 return mapping.findForward("NoPrivilege");
			 else{
				 
				 return mapping.findForward("addUser");
			 }
		}else{
		     return mapping.findForward("NotLogin");		
		}
	}
}
